package com.zhentao.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 告警统计表
 * @TableName alert_statistics
 */
@TableName(value ="alert_statistics")
@Data
public class AlertStatistics implements Serializable {
    /**
     * 统计ID
     */
    @TableId(type = IdType.AUTO)
    private Long statId;

    /**
     * 统计日期
     */
    private Date statDate;

    /**
     * 设备ID
     */
    private Long deviceId;

    /**
     * 告警级别
     */
    private Integer alertLevel;

    /**
     * 告警总数
     */
    private Integer totalCount;

    /**
     * 已处理数
     */
    private Integer handledCount;

    /**
     * 待处理数
     */
    private Integer pendingCount;

    /**
     * 创建时间
     */
    private Date createTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        AlertStatistics other = (AlertStatistics) that;
        return (this.getStatId() == null ? other.getStatId() == null : this.getStatId().equals(other.getStatId()))
            && (this.getStatDate() == null ? other.getStatDate() == null : this.getStatDate().equals(other.getStatDate()))
            && (this.getDeviceId() == null ? other.getDeviceId() == null : this.getDeviceId().equals(other.getDeviceId()))
            && (this.getAlertLevel() == null ? other.getAlertLevel() == null : this.getAlertLevel().equals(other.getAlertLevel()))
            && (this.getTotalCount() == null ? other.getTotalCount() == null : this.getTotalCount().equals(other.getTotalCount()))
            && (this.getHandledCount() == null ? other.getHandledCount() == null : this.getHandledCount().equals(other.getHandledCount()))
            && (this.getPendingCount() == null ? other.getPendingCount() == null : this.getPendingCount().equals(other.getPendingCount()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getStatId() == null) ? 0 : getStatId().hashCode());
        result = prime * result + ((getStatDate() == null) ? 0 : getStatDate().hashCode());
        result = prime * result + ((getDeviceId() == null) ? 0 : getDeviceId().hashCode());
        result = prime * result + ((getAlertLevel() == null) ? 0 : getAlertLevel().hashCode());
        result = prime * result + ((getTotalCount() == null) ? 0 : getTotalCount().hashCode());
        result = prime * result + ((getHandledCount() == null) ? 0 : getHandledCount().hashCode());
        result = prime * result + ((getPendingCount() == null) ? 0 : getPendingCount().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", statId=").append(statId);
        sb.append(", statDate=").append(statDate);
        sb.append(", deviceId=").append(deviceId);
        sb.append(", alertLevel=").append(alertLevel);
        sb.append(", totalCount=").append(totalCount);
        sb.append(", handledCount=").append(handledCount);
        sb.append(", pendingCount=").append(pendingCount);
        sb.append(", createTime=").append(createTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}